package cn.tedu.community.commons.pojo.user.dto;


import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户注册DTO
 */
@Data
public class UserRegDTO implements Serializable {
    @NotNull(message = "请输入用户名！")
    @Pattern(regexp = "^[\\u4E00-\\u9FA5A-Za-z0-9]{2,10}+$",
            message = "请输入2-10位中文、英文、数字但不包括下划线等符号的用户名！" )
    private String userName;

    @NotNull(message = "请输入密码！")
    @Pattern(regexp = "^[a-zA-Z0-9]{8,18}$",
            message = "请输入8-18位包含英文、数字的密码！")
    private String userPassword;

    @NotNull(message = "请再次输入密码！")
    @NotEmpty(message = "请再次输入密码！")
    private String confirmPassword;

    @NotNull(message = "请输入您的手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$",
            message = "手机号码格式不正确,请重新输入!")
    private String userPhone;
}
